package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 攻略评论
 * @author totoro93
 * @date
 */
@Getter@Setter
public class StrategyComment extends BaseDomain {

    /**
     * 普通
     */
    public static final Integer STATE_COMMON = 1;
    /**
     * 推荐
     */
    public static final Integer STATE_HOT = 2;
    /**
     * 禁用
     */
    public static final Integer STATE_DISABLE = -1;
    /**
     * 评论用户
     */
    private User user;
    /**
     * 评论创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createTime;
    /**
     * 评论内容
     */
    private String content;
    /**
     * 评论图片
     */
    private String imgUrls ;
    /**
     * 评论星级
     */
    private Integer starNum;
    /**
     * 评论所属公路攻略
     */
    private Strategy strategy;
    /**
     * 评论状态
     */
    private Integer state=STATE_COMMON ;
    /**
     * 评论发布时间
     */
    private Date commendTime;

    /**
     * 获取评论图片一组url
     * @return
     */
    public String[] getImgArr() {
        if (StringUtils.hasLength(imgUrls)) {
            return imgUrls.split(";");
        }
        return null;
    }


    public String getStateName() {


        return null;
    }


}